﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="query.aspx.cs" Inherits="AnyOffice.general.news.manage.query" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>公告通知查询</title>
		
		<link rel="stylesheet" type="text/css" href="/module/date_selector/popcalendar.css">
			<script src="/module/date_selector/popcalendar.js"></script>
			<script src="/aspnet_client/core/function.js"></script>
			<script Language="JavaScript" type="text/javascript">
			function CheckForm()
			{
			if(!checkIsDate(document.Form1.txtSendTimeMIN.value))
			{
				alert("开始日期不正确！");
				document.Form1.txtSendTimeMIN.focus();
				return (false);
			}
			   
			if(!checkIsDate(document.Form1.txtSendTimeMAX.value))
			{
				alert("结束日期不正确！");
				document.Form1.txtSendTimeMAX.focus();
				return (false);
			}
			return (true);
			}

			function open_news(news_id)
			{
//				URL="read_news.aspx?news_id="+news_id;
//				myleft=(screen.availWidth-500)/2;
//				window.open(URL,"read_news","height=400,width=550,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left="+myleft+",resizable=yes");

				var mwidth = "600";
				var mheight = "450";
				var loc_x = parseInt((window.screen.width - mwidth) / 2);
				var loc_y = parseInt((window.screen.height - mwidth) / 2);

				var _oParameter = new Object();
				_oParameter.dialogTitle = "简报查看";
				_oParameter.openFile = "read_news.aspx?news_id=" + news_id + "&num=" + Math.random();

				window.showModalDialog('shDialog.htm', _oParameter, 'dialogHeight:' + mheight + 'px;dialogWidth:' + mwidth + 'px;dialogLeft:' + loc_x + ';dialogTop:' + loc_y + ';help:no;status:no;scroll:yes;titlebar:no;toolbar:no');
  
   
            
            
            
            }

function open_news(news_id)
{
// URL="read_news.aspx?news_id="+news_id;
// myleft=(screen.availWidth-500)/2;
// mytop=150
// mywidth=600;
// myheight=500;
// window.open(URL,"read_news","height="+myheight+",width="+mywidth+",status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");


 var mwidth = "600";
 var mheight = "450";
 var loc_x = parseInt((window.screen.width - mwidth) / 2);
 var loc_y = parseInt((window.screen.height - mwidth) / 2);

 var _oParameter = new Object();
 _oParameter.dialogTitle = "简报查看";
 _oParameter.openFile = "read_news.aspx?news_id=" + news_id + "&num=" + Math.random();

 window.showModalDialog('shDialog.htm', _oParameter, 'dialogHeight:' + mheight + 'px;dialogWidth:' + mwidth + 'px;dialogLeft:' + loc_x + ';dialogTop:' + loc_y + ';help:no;status:no;scroll:yes;titlebar:no;toolbar:no');
  
   




}

function delete_news(news_id,page)
{
 msg='确认要删除该项新闻么？';
 if(window.confirm(msg))
 {
  URL="delete.aspx?news_id=" + news_id + "&page=" + page;
  window.location=URL;
 }
}


function change_type(type_id)
{
 window.location="index1.aspx?type_id="+type_id;
}

function re_news(news_id)
{
// URL="re_news.aspx?news_id="+news_id;
// myleft=(screen.availWidth-500)/2;
// window.open(URL,"read_news","height=500,width=550,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=100,left="+myleft+",resizable=yes");

 var mwidth = "600";
 var mheight = "450";
 var loc_x = parseInt((window.screen.width - mwidth) / 2);
 var loc_y = parseInt((window.screen.height - mwidth) / 2);

 var _oParameter = new Object();
 _oParameter.dialogTitle = "简报查看";
 _oParameter.openFile = "re_news.aspx?news_id=" + news_id + "&num=" + Math.random();

 window.showModalDialog('shDialog.htm', _oParameter, 'dialogHeight:' + mheight + 'px;dialogWidth:' + mwidth + 'px;dialogLeft:' + loc_x + ';dialogTop:' + loc_y + ';help:no;status:no;scroll:yes;titlebar:no;toolbar:no');
  
   





}                                           
		</script>

	</HEAD>
	<body class="bodycolor" style="padding-top:0;" topmargin="5">
		<form id="Form1" method="post" runat="server">
          <div class="main_div">
			<table border="0" width="90%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="Big"><img align="absMiddle" src="/images/menu/infofind.gif"><span class="big3">
							<asp:Literal id="litNavTitle" runat="server"></asp:Literal>
						</span>
					</td>
				</tr>
			</table>
			<br>
			<asp:Panel id="pnlMain" runat="server">
				<TABLE class="small" cellSpacing="1" cellPadding="2" width="500" align="center" border="0" bgcolor=#000000>
					<TR>
						<TD class="TableData" noWrap width="100">标题：</TD>
						<TD class="TableData"><INPUT class="BigInput" id="txtSubject" type="text" maxLength="100" size="33" name="txtSubject"
								runat="server">
						</TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>类型：</TD>
						<TD class="TableData"><SELECT class="BigSelect" id="sltTypeId" name="sltTypeId" runat="server" DataValueField="TypeId"
								DataTextField="TypeName"></SELECT>
						</TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>发布人：</TD>
						<TD class="TableData"><INPUT id="UserIds" type="hidden" name="UserIds" runat="server"> <TEXTAREA class="BigStatic" id="UserNames" name="UserNames" rows="3" readOnly wrap="yes" cols="30"
								runat="server"></TEXTAREA> &nbsp;<INPUT class="SmallButton" title="添加人员" onclick="user_select('UserIds','UserNames','');" type="button" value="选 择"
								name="button"> &nbsp;<INPUT class="SmallButton" title="清空人员" onclick="clear_double('UserIds','UserNames');" type="button" value="清 空"
								name="button"></TD>
					</TR>
					</tr>
					<TR>
						<TD class="TableData" noWrap width="100">发布日期：</TD>
						<TD class="TableData"><INPUT class="BigInput" id="txtSendTimeMIN" type="text" maxLength="10" size="12" name="txtSendTimeMIN"
								runat="server"> <IMG style="CURSOR: hand" onclick="popUpCalendar(this,txtSendTimeMIN,'yyyy-mm-dd','');"
								src="/module/date_selector/calendar.gif" align="absMiddle" border="0"> 至&nbsp;
							<INPUT class="BigInput" id="txtSendTimeMAX" type="text" maxLength="10" size="12" name="SendTimeMAX"
								runat="server"> <IMG style="CURSOR: hand" onclick="popUpCalendar(this,txtSendTimeMAX,'yyyy-mm-dd','');"
								src="/module/date_selector/calendar.gif" align="absMiddle" border="0">
						</TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap width="100">内容：</TD>
						<TD class="TableData"><INPUT class="BigInput" id="txtContent" type="text" maxLength="200" size="33" name="txtContent"
								runat="server">
						</TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap width="100">操作：</TD>
						<TD class="TableData">
										<asp:RadioButtonList id="rblAction" runat="server" RepeatDirection="Horizontal" Font-Size="12px">
											<asp:ListItem Value="query" Selected="True">查询</asp:ListItem> 
										</asp:RadioButtonList>
						</TD>
					</TR>
					<TR class="TableControl" align="center">
						<TD noWrap colSpan="2"><INPUT class="BigButton" onclick="return CheckForm();" type="submit" value="查询">&nbsp;&nbsp;
							<INPUT class="BigButton" type="reset" value="重填">&nbsp;&nbsp;
						</TD>
					</TR>
				</TABLE>
			</asp:Panel>
			<asp:Panel id="pnlLater" runat="server" Visible="False">
				<asp:Repeater id="rptNews" runat="server">
					<HeaderTemplate>
						<TABLE class="small" cellSpacing="1" cellPadding="3" width="100%" bgColor="#000000" border="0">
							<tr class="TableHeader">
								<td nowrap align="center" width="30%">标题</td>
								<TD noWrap align="center">类型</TD>
								<TD noWrap align="center">发送范围</TD>									
								<td nowrap align="center">发布人</td>
								<td nowrap align="center">发布时间</td>								
								<td nowrap align="center">操作</td>
							</tr>
					</HeaderTemplate>
					<ItemTemplate>
						<tr class="TableLine1">
							<td>
								<a href="javascript:open_news('<%#Eval("NewsId")%>');"><%#Eval("Subject")%></a>
							</td>
							<td align="center" nowrap><%#Eval("TypeName")%></td>
								<td>
									<%#Eval("ToDeptNames").ToString() != string.Empty ? "<font color=#0000FF><b>部门：</b></font>" + Eval("ToDeptNames").ToString()  + "<br>": ""%>
									<%#Eval("ToPrivNames").ToString() != string.Empty ? "<font color=#0000FF><b>角色：</b></font>" + Eval("ToPrivNames").ToString() + "<br>" : ""%>
									<%#Eval( "ToUser").ToString() != string.Empty ? "<font color=#0000FF><b>人员：</b></font>" + GetUserNames(Eval( "ToUser").ToString()) : ""%>
								</td>
							<td nowrap align="center"><u title="部门：<%#Eval("DeptName")%>" style="cursor:hand"><%#Eval("UserName")%></u></td>
							<td nowrap align="center"><%#Eval("SendTime")%></td>							
						<td nowrap align="center"><a href="javascript:re_news('<%#Eval("NewsId")%>');">评论</a></td>
						</tr>
					</ItemTemplate>
					<AlternatingItemTemplate>
						<tr class="TableLine2">
							<td>
								<a href="javascript:open_news('<%#Eval("NewsId")%>');"><%#Eval("Subject")%></a>
							</td>
							<td align="center" nowrap><%#Eval("TypeName")%></td>
								<td>
									<%#Eval("ToDeptNames").ToString() != string.Empty ? "<font color=#0000FF><b>部门：</b></font>" + Eval("ToDeptNames").ToString()  + "<br>": ""%>
									<%#Eval("ToPrivNames").ToString() != string.Empty ? "<font color=#0000FF><b>角色：</b></font>" + Eval("ToPrivNames").ToString() + "<br>" : ""%>
									<%#Eval( "ToUser").ToString() != string.Empty ? "<font color=#0000FF><b>人员：</b></font>" + GetUserNames(Eval( "ToUser").ToString()) : ""%>
								</td>
							<td nowrap align="center"><u title="部门：<%#Eval("DeptName")%>" style="cursor:hand"><%#Eval("UserName")%></u></td>
							<td nowrap align="center"><%#Eval("SendTime")%></td>							
							<td nowrap align="center"><a href="javascript:re_news('<%#Eval("NewsId")%>');">评论</a></td>
						</tr>
					</AlternatingItemTemplate>
					<FooterTemplate>
						</TABLE>
					</FooterTemplate>
				</asp:Repeater>
				<asp:Literal id="litMessage" runat="server"></asp:Literal>
				<BR>
				<CENTER><INPUT class="BigButton" onclick="history.back();" type="button" value="返回"></CENTER>
				<BR>
			</asp:Panel>
            </div>
		</form>
	</body>
</HTML>
